package top.jacktgq.sxt.bio.error_discrimination;

import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.net.Socket;

/**
 * @Author CandyWall
 * @Date 2019/11/14--13:02
 * @Description 模拟数据采集模块发送数据
 */
public class Data_acquClient {
    public static void main(String[] args) throws Exception {
        Socket client = new Socket("localhost",8888);
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));
        int i=0;
        while (true && i < 100) {
            System.out.println(i + "#" + "4G00001" + "#" + Math.sin(i/1000.0));
            bw.write(i + "#" + "4G00001" + "#" + Math.sin(i/1000.0) + "\n");
            bw.flush();
            Thread.sleep(10);
            i++;
        }
        bw.close();
        client.close();
    }
}
